package com.emm.yixun.mobile.ui.customer;

import android.app.Activity;
import android.os.Handler;
import android.webkit.JavascriptInterface;

/**
 * Created by tangxin on 2018/1/24.
 */

public abstract class OpenApp {
    Activity activity;

    OpenApp(Activity activity) {
        this.activity = activity;
    }

    /**
     * JS 调用方式：window.openApp.onBack("0");
     */
    @JavascriptInterface
    public void onBack(final String doType) {
        new Handler().post(new Runnable() {
            @Override
            public void run() {
                if ("0".equals(doType)) {
                    canBackReLoad();
                }
            }
        });
    }

    public abstract void canBackReLoad();

}
